<template>
  <div id="aCoursesList" class="bg-fa of">
    <y-header></y-header>
  <!--讲师列表 -->
   <div class="courselist_page">
    <div class="course_content">
      <ul class="clearfix">
        <li v-for="(item, index) in list" :key="index">
          <nuxt-link target="_blank" :to="{name: 'teacher-id', params: {id: item.id}}" class="course_info">
            <div class="img_box">
              <img class="course_img" :src="item.courseLogo" alt="">
            </div>
            <p>{{item.courseName}}</p>
            <span class="price_box" v-if="item.isFree">免费</span>
            <span class="price_box" v-else>￥{{item.courseOriginal.toFixed(2)}}<span class="font_12 padl_10" v-if="openVip && item.courseOriginal !== item.courseDiscount">SVIP:{{item.courseDiscount ? '￥' + item.courseDiscount.toFixed(2) : '免费'}}</span></span>
          </nuxt-link>
        </li>
      </ul>
      <d-page v-if="totalPage > 1" :page="pageObj" @btnClick="getPage"></d-page>
    </div>
    <y-footer></y-footer>
  </div>
  </div>
</template>
 <script>
  // import teacherApi from '@/api/teacher'
  import YHeader from '~/components/common/Header'
  import YFooter from '~/components/common/Footer'
  export default {
    data() {
      return{
          total:0,
          pages:10,
          pageCurrent:1,
          pageSize:20,
          totalCount:4,
          totalPage:1,
          list:[
            {
              courseDiscount:0,
              courseLogo:"https://cllearning.oss-cn-shenzhen.aliyuncs.com/course/8245a3f7a09642b9a9ec6a2ea525a029.png",
              courseName:"张杰",
              courseOriginal:0,
              id:"1492513175231270915",
              isFree:1,

            },{
              courseDiscount:0,
              courseLogo:"https://cllearning.oss-cn-shenzhen.aliyuncs.com/course/8245a3f7a09642b9a9ec6a2ea525a029.png",
              courseName:"张杰",
              courseOriginal:0,
              id:"1492513175231270916",
              isFree:1,

            },{
              courseDiscount:0,
              courseLogo:"https://cllearning.oss-cn-shenzhen.aliyuncs.com/course/8245a3f7a09642b9a9ec6a2ea525a029.png",
              courseName:"张杰",
              courseOriginal:0,
              id:"1492513175231270917",
              isFree:1,

            },{
              courseDiscount:0,
              courseLogo:"https://cllearning.oss-cn-shenzhen.aliyuncs.com/course/8245a3f7a09642b9a9ec6a2ea525a029.png",
              courseName:"张杰",
              courseOriginal:0,
              id:"1492513175231270918",
              isFree:1,

            }
          ],
          }
    },
   
    methods: {
      // gotoPage(page) {
      //   teacherApi.getFrontTeacherPageList(page,4).then( response => {
      //      this.data = response.data.data
      //   })
      // }
    },
    components: {
    YHeader,
    YFooter,
  }
  };
</script>
<style lang="scss" rel="stylesheet/scss">
.courselist_page {
  .course_content {
    background: rgb(245, 245, 245);
    padding: 30px 0 10px 0;
    min-height: 600px;
    ul p{
      font-size: 21px;
      margin-top: 10px;
      color:green;
      font-weight: bold;
    }
    ul {
      width: 1200px;
      margin: 0 auto;
    }
    li {
      float: left;
      border-radius: 6px;
      background: #fff;
      margin: 0px 20px 20px 0px;
      &:nth-child(4n) {
        margin-right: 0px;
      }
    }
  }
  .course_info {
    display: block;
    width: 285px;
    height: 240px;
    border-radius: 6px;
    position: relative;
    &:hover {
      text-decoration: none;
      color: #000;
      box-shadow: 0px 3px 18px rgba(0, 0, 0, 0.2);
      transform: translateY(-2px);
      transition: all .3s;
    }
    .img_box {
      position: relative;
      width: 285px;
      height: 140px;
      .qizi {
        background: url(../../assets/image/activity/qizi.png) no-repeat center;
        position: absolute;
        top: 0;
        left: 10px;
        width: 46px;
        height: 43px;
        padding-top: 3px;
        color: #fff;
        font-size: 14px;
        text-align: center;
      }
      .course_img {
        width: 285px;
        height: 140px;
        border-radius: 6px 6px 0 0;
      }
    }
    p {
      font-size: 16px;
      margin-top: 5px;
      padding: 0 10px;
      word-break: break-all;
    }
    .price_box {
      font-size: 18px;
      position: absolute;
      bottom: 25px;
      
      left: 10px;
      font-weight: bold;
      color: orange;
    }
  }
}
</style>
